// import {API_ROOT, imBackerUrl, imHttpUrl} from './../../static/config'
import {fetch, postData, postJson, imFetch} from './../service/httpService';
//登录接口
export const postLogin = (body) => {
  return postJson(commonUrl.API_ROOT + 'admin/login', body)
}

//修改密码
export const alterPassword = (body) => {
  return postJson(commonUrl.API_ROOT + 'admin/password/alter', body)
}

//查看管理员列表
export const getAdminList = (body) => {
  return fetch(commonUrl.API_ROOT + 'admin/list/get', body)
}

//添加管理员
export const addAdmin = (body) => {
  return postJson(commonUrl.API_ROOT + 'admin/add', body)
}

//修改管理员
export const alterAdmin = (body) => {
  return postJson(commonUrl.API_ROOT + 'admin/alter', body)
}

//禁用管理员
export const forbiddenAdmin = (body) => {
  return postJson(commonUrl.API_ROOT + 'admin/forbidden', body)
}

//查看用户列表
export const getUserList = (body) => {
  return fetch(commonUrl.API_ROOT + 'user/search', body)
}
//修改用户资料
export const editUserAlter = (body) => {
  return postJson(commonUrl.API_ROOT + 'user/alter', body)
}

//禁用用户接口
export const editForbidden = (body) => {
  return postJson(commonUrl.API_ROOT + 'user/forbidden', body)
}

//查看列表
export const photowallList = (body) => {
  return fetch(commonUrl.API_ROOT + 'photowall/list/get', body)
}


//查看用户照片
export const getPhotoInfo = (body) => {
  return fetch(commonUrl.API_ROOT + 'photowall/info/get', body)
}

//查看用户照片
export const deletePhotowall = (body) => {
  return postJson(commonUrl.API_ROOT + 'photowall/delete', body)
}

//设置封面
export const setcoverPhotowall = (body) => {
  return postJson(commonUrl.API_ROOT + 'photowall/setcover', body)
}


//聊天相关
//分配陪聊机器人
export const getOLRobots = (body) => {
  return fetch(commonUrl.imBackerUrl + 'artificialchat/virtualuser', body)
}
//
//通过accId获取用户历史消息
export const getMsgsHistory = (data) => {
  return imFetch(commonUrl.imHttpUrl + 'message/history', data)
}

//通过accId获取用户离线消息
export const getMsgOffline = (data) => {
  return imFetch(commonUrl.imHttpUrl + 'message/p2p/offline', data)
}

//通过accId获取用户信息
export const getUserInfo = (data) => {
  return fetch(commonUrl.imBackerUrl + 'artificialchat/user/info', data)
}

//所有未处理消息
export const getOffMsgCount = (data) => {
  return fetch(commonUrl.imBackerUrl + 'artificialchat/allunreadcnt', data)
}
//喜欢选择列表
export const getLoveLst = (data) => {
  return fetch(commonUrl.imBackerUrl + 'artificialchat/like/list', data)
}

//喜欢还是不喜欢
export const likeOrHate = (data) => {
  return postJson(commonUrl.imBackerUrl + 'artificialchat/like/agree', data)
}

//搜索认证资料
export const searchAuthen = (data) => {
  return fetch(commonUrl.API_ROOT + 'auditmaterial/user/list', data);
}
//提交审核
export const examineInfo = (data) => {
  return postJson(commonUrl.API_ROOT + 'auditmaterial/user/review', data);
}

//问答列表
export const getQuestionList = (data) => {
  return fetch(commonUrl.API_ROOT + 'question/list/get', data);
}

//提交审核
export const questionEdit = (data) => {
  return postJson(commonUrl.API_ROOT + 'question/edit', data);
}

//提交审核
export const questionDelete = (data) => {
  return postJson(commonUrl.API_ROOT + 'question/delete', data);
}

//日志详情
export const getArtDetail = (data) => {
  return fetch(commonUrl.API_ROOT + 'community/art/info/get', data);
}

//日志/视频列表
export const getArtList = (data) => {
  return fetch(commonUrl.API_ROOT + 'community/art/list', data);
}

//话题列表
export const getTopicList = (data) => {
  return fetch(commonUrl.API_ROOT + 'community/topic/list', data);
}


//视频推荐
export const recommendVideo = (data) => {
  return postJson(commonUrl.API_ROOT + 'community/video/recommend', data);
}

//审阅视频
export const reviewVideo = (data) => {
  return postJson(commonUrl.API_ROOT + 'community/video/review', data);
}
 
//日志编辑
export const editArtItem = (data) => {
  return postJson(commonUrl.API_ROOT + 'community/art/edit', data);
}
 
//删除日志
export const deleteArtItem = (data) => {
  return postJson(commonUrl.API_ROOT + 'community/art/delete', data);
}

 
//用户权限
export const forbidShows = (data) => {
  return postJson(commonUrl.API_ROOT + 'user/forbid/shows', data);
}
 
//上传图片
export const uploadFile = (data) => {
  return postJson(commonUrl.API_ROOT + 'public/file/mupload', data);
}
 
//删除图片
export const deletePhoto = (data) => {
  return postJson(commonUrl.API_ROOT + 'question/delete/photo', data);
}


//获取当天聊天真实用户数和消息数
export const getMessageTotalInfo = (data) => {
  return fetch(commonUrl.API_ROOT + 'artificialchat/message/total', data);
}


//分享图片列表
export const getShareData = (data) => {
  return fetch(commonUrl.API_ROOT + 'share/list/get', data);
} 

//添加分享图片
export const addSharePhoto = (data) => {
  return postJson(commonUrl.API_ROOT + 'share/add', data);
}


//删除分享图片
export const deleteSharePhoto = (data) => {
  return postJson(commonUrl.API_ROOT + 'share/delete', data);
}
 
//公共删除阿里云照片
export const aliyunPhotoDelete = (data) => {
  return postJson(commonUrl.API_ROOT + 'public/aliyun/photo/delete', data);
}


//查询分享title
export const getShareTitleContent= (data) => {
  return fetch(commonUrl.API_ROOT + 'share/content/info/get', data);
} 


//编辑分享title
export const editShareTitle= (data) => {
  return postJson(commonUrl.API_ROOT + 'share/content/edit', data);
} 

// 删除用户
export const userDeleteFun= (data) => {
  return postJson(commonUrl.API_ROOT + 'user/delete', data);
} 

// 相册是否推荐
export const isRecommendUser= (data) => {
  return postJson(commonUrl.API_ROOT + 'user/update', data);
} 




